package com.lagou;

import java.io.IOException;

public class LagouServlet extends HttpServlet {


    @Override
    public void doGet(Request request, Response response) throws Exception {
        String context = "<h1>LagouServlet GET<h1/>";
        response.output(HttpProtocolUtils.getHttpHeader200(context.getBytes().length) + context);
    }

    @Override
    public void doPost(Request request, Response response) throws Exception {
        String context = "<h1>LagouServlet POST<h1/>";
        response.output(HttpProtocolUtils.getHttpHeader200(context.getBytes().length) + context);
    }

    @Override
    public void init() throws Exception {
        System.out.println("LagouServlet init ...");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("LagouServlet destroy ...");
    }
}
